package cn.orange.feign;

import cn.orange.User;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class getByIdfallbackFactory implements FallbackFactory<UserService> {
    @Override
    public UserService create(Throwable throwable) {
        return new UserService() {
            @Override
            public User getById(Long id) {
                return new User(-1L,"熔断了","请稍后重试!");
            }
        };
    }
}
